package com.cam.iot.factor.info.pojo.dto;

import com.cam.framework.crud.CrudDTO;
import com.cam.iot.factor.info.dict.IotFactorTypeDict;
import lombok.Data;

@Data
public class IotFactorDTO extends CrudDTO {

    /*
     * 名称
     * */
    private String name;

    /*
     * 编码
     * */
    private String code;

    /*
     * 监测因子单位
     * */
    private String unit;

    /*
     * 因子值类型
     * */
    private String type;

    public IotFactorTypeDict getTypeDict() {
        for (IotFactorTypeDict eachDict : IotFactorTypeDict.values()) {
            if (eachDict.getValue().equals(this.getType())) return eachDict;
        }
        return null;
    }

}
